package com.example.demo.servlet;

import com.example.demo.dao.OrderDetailDao;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/deleteOrderDetail")
public class DeleteOrderDetailVo extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        Integer id = Integer.valueOf(req.getParameter("id"));
        try {
            new OrderDetailDao().deleteOrderDetail(id);
            req.getRequestDispatcher("/getOrder").forward(req,resp);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
